#!/usr/bin/env python
PACKAGE = "graph_slam"
import roslib;roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("new_node_distance_T", double_t, 0, "translational distance after which to add a new node (m)", 0.3, 0.0, 10.0)
gen.add("new_node_distance_R", double_t, 0, "rotational distance after which to add a new node (deg)", 10.0, 0.0, 360.0)
gen.add("new_node_compute_cloud_edge", bool_t, 0, "true, if a point cloud/laser-based ICP should be attempted for each new node", True)

gen.add("do_feature_loop_closure", bool_t, 0, "true, if feature-based loop closure will be attempted", True)
gen.add("do_distance_loop_closure", bool_t, 0, "true, if loop closure will be attempted for nodes in a given radius to a new node", True)
gen.add("distance_loop_closure_radius", double_t, 0, "radius in which loop closures will be attempted", 0.5, 0.0, 10.0)

gen.add("max_edge_error", double_t, 0, "tolerated edge error", 0.3, 0.0, 10.0)
gen.add("min_matching_score", double_t, 0, "minimum score that an edge needs to have in order to be added to the graph", 20, 0.0, 1000.0)
gen.add("max_edge_distance_T", double_t, 0, "maximum edge translation allowed (m)", 1.0, 0.0, 100.0)
gen.add("max_edge_distance_R", double_t, 0, "maximum edge rotation allowed (deg)", 20.0, 0.0, 360.0)
gen.add("new_edge_time", double_t, -1, "minimum time between two edges", 5, -1, 100000)

gen.add("reevaluate_cloud_edges", bool_t, 0, "true, if a point cloud/laser-based ICP should be attempted regularly; edges will be replaced", False)
gen.add("reevaluate_cloud_edges_freq", double_t, 0, "freq of edge reevaluation in hz", 10.0, 0.1, 100.0)
gen.add("cloud_edge_min_matching_score", double_t, 0, "minimum score that a cloud/laser-based edge needs to have in order to be added to the graph", 30, 0, 1000)

gen.add("merge_nodes", bool_t, 0, "true, if nodes should be merged", False)
gen.add("merge_nodes_freq", double_t, 0, "freq of node merging in hz", 10.0, 0.1, 100.0)

gen.add("optimize_graph", bool_t, 0, "true, if the graph should be optimized", True)
gen.add("optimize_graph_freq", double_t, 0, "freq of graph optimization in hz", 0.2, 0.01, 10.0)

gen.add("scope_size_min", double_t, 0, "minimum size of the scope in m", 8, 0, 100)
gen.add("scope_size_factor", double_t, 0, "the scope size is the product of this value and the distance of the current to the oldest graph node; this is largely dependent on the odometry accuracy", 0.1, 0, 1)


exit(gen.generate(PACKAGE, "graph_slam", "GraphSlam"))
